﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UFSSWebApp
{
    public partial class forgotpassword : System.Web.UI.Page
    {
        UFSSservicereference.UFSSserviceSoapClient ussc = new UFSSservicereference.UFSSserviceSoapClient();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/index.aspx");
        }

        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            try
            {
                string result = ussc.forgotPass(txtUsername.Text, txtEmail.Text);
                if (!result.Equals(null))
                    //lblError.Text = "The Password has been sent to your registered email.";
                    lblError.Text = "Your password is temporarily displayed here: " + result;
                else
                    lblError.Text = "The information entered was incorrect.";
            }
            catch
            {
                lblError.Text = "The information entered was incorrect.";
            }
        }
    }
}